private $mEnableSectionEditLinks = true;
/**
- * @var string|null The URL to send in a <link> element with rel=copyright
+ * @var string|null The URL to send in a <link> element with rel=license
*/
private $copyrightUrl;
* @param bool $filter Whether to filter out insufficiently trustworthy modules
* @param string|null $position If not null, only return modules with this position
* @param string $param
+ * @param string $type
* @return array Array of module names
*/
public function getModules( $filter = false, $position = null, $param = 'mModules',
* Add one or more head items to the output
*
* @since 1.28
- * @param string|string[] $value Raw HTML
+ * @param string|string[] $values Raw HTML
*/
public function addHeadItems( $values ) {
$this->mHeadItems = array_merge( $this->mHeadItems, (array)$values );
* Add wikitext with a custom Title object
*
* @param string $text Wikitext
- * @param Title $title
+ * @param Title &$title
* @param bool $linestart Is this the start of a line?
*/
public function addWikiTextWithTitle( $text, &$title, $linestart = true ) {
* Add wikitext with a custom Title object and tidy enabled.
*
* @param string $text Wikitext
- * @param Title $title
+ * @param Title &$title
* @param bool $linestart Is this the start of a line?
*/
function addWikiTextTitleTidy( $text, &$title, $linestart = true ) {
/**
* Add the output of a QuickTemplate to the output buffer
*
- * @param QuickTemplate $template
+ * @param QuickTemplate &$template
*/
public function addTemplate( &$template ) {
$this->addHTML( $template->getHTML() );
}
/**
- * @param $maxage
+ * @param int $maxage
* @deprecated since 1.27 Use setCdnMaxage() instead
*/
public function setSquidMaxage( $maxage ) {
$pieces[] = $this->buildExemptModules();
$pieces = array_merge( $pieces, array_values( $this->getHeadLinksArray() ) );
$pieces = array_merge( $pieces, array_values( $this->mHeadItems ) );
+
+ $min = ResourceLoader::inDebugMode() ? '' : '.min';
+ // Use an IE conditional comment to serve the script only to old IE
+ $pieces[] = '<!--[if lt IE 9]>' .
+ Html::element( 'script', [
+ 'src' => self::transformResourcePath(
+ $this->getConfig(),
+ "/resources/lib/html5shiv/html5shiv{$min}.js"
+ ),
+ ] ) .
+ '<![endif]-->';
+
$pieces[] = Html::closeElement( 'head' );
$bodyClasses = [];
if ( $copyright ) {
$tags['copyright'] = Html::element( 'link', [
- 'rel' => 'copyright',
+ 'rel' => 'license',
'href' => $copyright ]
);
}
* Caller is responsible for ensuring the file exists. Emits a PHP warning otherwise.
*
* @since 1.27
- * @param string $remotePath URL path prefix that points to $localPath
+ * @param string $remotePathPrefix URL path prefix that points to $localPath
* @param string $localPath File directory exposed at $remotePath
* @param string $file Path to target file relative to $localPath
* @return string URL
* @param String $skinName The Skin name to determine the correct OOUI theme
* @param String $dir Language direction
*/
- public static function setupOOUI( $skinName = '', $dir = 'ltr' ) {
- $themes = ExtensionRegistry::getInstance()->getAttribute( 'SkinOOUIThemes' );
- // Make keys (skin names) lowercase for case-insensitive matching.
- $themes = array_change_key_case( $themes, CASE_LOWER );
- $theme = isset( $themes[$skinName] ) ? $themes[$skinName] : 'MediaWiki';
- // For example, 'OOUI\MediaWikiTheme'.
+ public static function setupOOUI( $skinName = 'default', $dir = 'ltr' ) {
+ $themes = ResourceLoaderOOUIModule::getSkinThemeMap();
+ $theme = isset( $themes[$skinName] ) ? $themes[$skinName] : $themes['default'];
+ // For example, 'OOUI\WikimediaUITheme'.
$themeClass = "OOUI\\{$theme}Theme";
OOUI\Theme::setSingleton( new $themeClass() );
OOUI\Element::setDefaultDir( $dir );
'oojs-ui.styles.indicators',
'oojs-ui.styles.textures',
'mediawiki.widgets.styles',
+ 'oojs-ui.styles.icons-content',
+ 'oojs-ui.styles.icons-alerts',
+ 'oojs-ui.styles.icons-interactions',
] );
}